<?php

class ZFEngine_Form_Decorator_LabelDescription extends Default_Form_Decorator_ElementWrapperAbstract
{

    /**
     * Список элементов для обработки
     * @var array
     */
    protected $_elementsType = array();

    /**
     *  Render income
     *
     * @param string $content
     * @return string
     */
    public function render($content)
    {
        $description = $this->getElement()->getDescription();
        $content = preg_replace('#(<p class="description">.*?</p>)#', '', $content);
        $content = preg_replace('#(</label>)#', '<span>' . $description . '</span>$1', $content);
        return $content;
    }

}